package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Author：汤小洋
 * Date：2022-11-24 15:33
 * Description：<描述>
 */
@Controller
public class HelloController {

    @RequestMapping("/hello")
    public ModelAndView hello(String name){
        System.out.println("HelloController.hello.............."+name);

        ModelAndView mav = new ModelAndView();
        mav.addObject("msg","欢迎您：" + name);
        mav.setViewName("hello"); // 拼接前缀和后缀  /WEB-INF/views/hello.jsp

        return mav;
    }

}
